home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / ust1a.arc / MKP < prev    next >
Encoding:
Text File  |  1985-09-05  |  1.7 KB  |  82 lines

  1. #!/bin/csh -f
  2. # This is the make pre-processor program written in the 'C' shell.
  3. #
  4. #   mkp defines a group of parameters and passes them to make.
  5. #   SWITCHES:
  6. #       -f <filename>
  7. #           source <filename. priore to invoking make.
  8. #           If -f is not present and .mkprc exists in the current directory
  9. #           it is sourced. Otherwise if .mkprc exists in the home directory
  10. #           it is sourced.
  11. #       -- 
  12. #           argument parsing is terminated remainder of command line is passed
  13. #           to make as is.
  14. #
  15. set MKPFILE=.mkprc
  16. set mkpname=$0
  17. set mkpname=$mkpname:t
  18. # ### VISIBLE MAKE TOOLS
  19. set MAKE=make
  20. set CC=cc
  21. set AS="as -"
  22. set LK=""
  23. set LD=""
  24. set LINT="lint -u"
  25. set REMOVE="rm -f"
  26. set CTAGS="ctags -w"
  27. # Internal parametrs
  28. set INCFLAGS = -I.
  29. # ### VISIBLE MAKE PARAMETERS
  30. #set CFLAGS = "${INCFLAGS} -DBSD4_2 -Uunix -DMSDOS"
  31. set CFLAGS = "${INCFLAGS} -DBSD4_2 "
  32. set LINTFLAGS = ${INCFLAGS}
  33. set TARGETS
  34. # MKP FLAGS
  35. set S_MKPFILE
  36. umask 002
  37. #
  38. #
  39. # Gather command line options
  40. #
  41. foreach i ($*)
  42.     switch ($1)
  43.     case -f:
  44.         shift argv
  45.         set S_MKPFILE=$1
  46.         breaksw
  47.     case --:
  48.         shift argv
  49.         break
  50.     default:
  51.         break
  52.         breaksw
  53.     endsw
  54.     shift argv
  55. end
  56. #
  57. #
  58. #
  59. #
  60. if ("$S_MKPFILE" != "") then
  61.     set MKPFILE = "$S_MKPFILE"
  62.     source $MKPFILE
  63. else if (-f $MKPFILE) then
  64.     source $MKPFILE
  65. else if (-f $HOME/$MKPFILE) then
  66.     source $HOME/$MKPFILE
  67. endif
  68. #
  69. set TARGETS="$*"
  70. #
  71. $MAKE  "CC=$CC" "AS=$AS" \
  72.     "CFLAGS=$CFLAGS" "LINTFLAGS=$LINTFLAGS" \
  73.     "LINT=$LINT"  \
  74.     "REMOVE=$REMOVE" "CTAGS=$CTAGS" \
  75.     $TARGETS
  76. set ret=$status
  77. if ("$ret" != "0") then
  78.     exit 1
  79. endif
  80. exit 0
  81.